home *** CD-ROM | disk | FTP | other *** search
- // Copyright (C) 1997-2002 Alias|Wavefront,
- // a division of Silicon Graphics Limited.
- //
- // The information in this file is provided for the exclusive use of the
- // licensees of Alias|Wavefront. Such users have the right to use, modify,
- // and incorporate this code into other products for purposes authorized
- // by the Alias|Wavefront license agreement, without fee.
- //
- // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
- // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
- // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
- // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
- // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- // PERFORMANCE OF THIS SOFTWARE.
- //
- //
- // Alias|Wavefront Script File
- //
- // Creation Date: Feb 8, 1999
- // Author: Carol Levy
- //
- // Procedure Name:
- // AEdynGlobalsTemplate
- //
- // Description Name;
- // Creates the attribute editor controls for dynGlobals Node
- //
- // Input Value:
- // nodeName
- //
- // Output Value:
- // None
- //
-
- //
- // Procedure Name:
- // AEdynGlobalsTemplate
- //
-
-
- global proc oversampleCallback ( string $nodeName )
- {
- // compare overSamples value to internalOverSamples value
- //
- string $nodeAttr = $nodeName + ".os";
- int $value = `getAttr $nodeAttr`;
- int $internalValue = `getAttr ($nodeName+".ios")`;
-
- if ( $value != $internalValue && ($internalValue > 0)) {
- $value = $internalValue;
- setAttr ($nodeAttr) $internalValue;
- warning("Converting oversample value to nearest supported oversample value.");
- } else if ($value != 1) {
- float $playbackSpeed = `playbackOptions -q -by`;
- float $osValue = (1.0/$value);
- float $ratio = ($osValue / $playbackSpeed);
- int $intRatio = $ratio;
- if (($ratio - $intRatio) != 0) {
- string $confirmString = "You will need to modify the Playback Speed in the Animation Preferences to ";
- $confirmString += $osValue;
- $confirmString += " in order for playback to match rendering with this oversampling setting.";
- confirmDialog
- -m $confirmString
- -b "OK" -db "OK";
- }
- }
- }
-
- global proc useParticleDiskCacheCallback ( string $nodeName )
- {
- string $nodeAttr = $nodeName + ".useParticleDiskCache";
- string $value = `getAttr $nodeAttr`;
-
- if ( $value ) {
- if (`about -evalVersion`) {
- setAttr ($nodeAttr) 0;
- // Because dynExport is disabled in PLE, this attribute
- // is ignored, so don't bother letting people set it.
- //
- confirmDialog
- -m "Particle disk caching is not supported in Maya PLE."
- -b "Cancel" -db "Cancel";
- return;
- }
-
- // enable attribute controls.
- // but keep the min and max frame locked
- //
- editorTemplate -dimControl $nodeName "cacheDirectory" false;
- editorTemplate -dimControl $nodeName "minFrameCached" false;
- editorTemplate -dimControl $nodeName "maxFrameCached" false;
- // setAttr -lock true ($nodeName+".minFrameCached");
- // setAttr -lock true ($nodeName+".maxFrameCached");
- } else {
- editorTemplate -dimControl $nodeName "cacheDirectory" true;
- editorTemplate -dimControl $nodeName "minFrameCached" true;
- editorTemplate -dimControl $nodeName "maxFrameCached" true;
- // setAttr -lock true ($nodeName + ".minFrameCached");
- // setAttr -lock true ($nodeName + ".maxFrameCached");
- }
- }
-
- global proc AEdynGlobalsTemplate ( string $nodeName )
- {
- editorTemplate -beginScrollLayout;
-
- editorTemplate -beginLayout "Oversampling" -collapse 0;
-
- editorTemplate -addControl "overSamples" "oversampleCallback";
-
- editorTemplate -endLayout;
-
- //editorTemplate -beginLayout "Particle Disk Cache for Rendering" -collapse 0;
- editorTemplate -beginLayout "Particle Disk Cache" -collapse 0;
-
- editorTemplate -addControl "useParticleDiskCache" "useParticleDiskCacheCallback";
- editorTemplate -addControl "cacheDirectory";
- editorTemplate -addControl "minFrameCached";
- editorTemplate -addControl "maxFrameCached";
- // setAttr -lock true ($nodeName + ".minFrameCached");
- // setAttr -lock true ($nodeName + ".maxFrameCached");
-
- editorTemplate -endLayout;
-
- // suppress some inherited attributes from the extras tab.
- //
- editorTemplate -suppress "nodeState";
- editorTemplate -suppress "caching";
- editorTemplate -suppress "pathVerified";
- editorTemplate -suppress "confirmSceneName";
-
- editorTemplate -addExtraControls;
-
- editorTemplate -endScrollLayout;
- }
-
-